import BaseConfig from "./base"

export function login(data) {
    return BaseConfig({
        method: 'post',
        url: "/login",
        data
    })
}



export function hasUser(username) {
    return BaseConfig({
        method: "get",
        url: "/has_user",
        params: {
            username
        }
    })
}



//获取所有阅览室
export function getReadingRoom() {
    return BaseConfig({
        method: "get",
        url: "/reading_room"
    })
}

export function register(data) {
    return BaseConfig({
        method: 'post',
        url: "/register",
        data
    })
}

export function changePwd(password) {
    return BaseConfig({
        method: 'post',
        url: "/change_pwd",
        data: {
            password
        }
    })
}

export function verifyPwd(password) {
    return BaseConfig({
        method: 'post',
        url: "/verify_pwd",
        data: {
            password
        }
    })

}